<?php
include("../config/config.php");
include("include/function.php");
$sid=$_GET['i'];
if (strlen($sid) <> 24) exit('Error -1');
$db_link=DB_Link();
$row_video=mysqli_fetch_array(mysqli_query($db_link,"SELECT * FROM video_list WHERE sid = '".$sid."'"));
if (empty($row_video['ID'])){
    echo "Error -2";
    exit;
}
if ($row_video['status <> 2']) die('Error -3');
$path="/".$row_video['day']."/".$row_video['random'];
$xml=$path."/index.xml";
$main=$path."/index.m3u8";
header("Content-Type: application/json; charset=utf-8");
?>
{"xml":"<?php echo $xml; ?>","main":"<?php echo $main; ?>"}